package com.atguigu.es.service;

import com.atguigu.es.dao.ArticleDao;
import com.atguigu.es.entity.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    private ArticleDao articleDao;

    @Override
    public void save(Article article) {
        articleDao.save(article);
    }

    @Override
    public List<Article> findByTitleOrContent(String title, String content) {
        return articleDao.findByTitleOrContent(title, content);
    }

    @Override
    public List<Article> findByTitle(String title) {
        return articleDao.findByTitle(title);
    }
}
